//package xin.cymall.listener;
//
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.core.ChannelAwareMessageListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.rabbitmq.client.Channel;
//
//import xin.cymall.service.SysLogService;
//
//@Component("userOrderListener")
//public class UserOrderListener implements ChannelAwareMessageListener{
//	private static final Logger log = LoggerFactory.getLogger(CommonMqListener.class);
//
//	@Autowired
//	private ObjectMapper objectMapper;
//
//	@Autowired
//	private SysLogService sysLogService;
//	
//	@Override
//	public void onMessage(Message message, Channel channel) throws Exception {
//		// TODO Auto-generated method stub
//		long tag = message.getMessageProperties().getDeliveryTag();
//		
//		try {
//			byte[] body = message.getBody();
//			String mobile = new String(body,"UTF-8");
//			log.info("监听到抢单手机号:"+mobile);
//			
//			sysLogService.manageRobbing(mobile);
//			channel.basicAck(tag,true);//确认消费
//			
//		} catch (Exception e) {
//			channel.basicAck(tag,false);//确认消费
//		}
//	}
//}
